﻿@using System.Web.Mvc;
<div class="user-display">
    @if (WorkContext.CurrentUser != null)
    {
        <span class="user-actions welcome">
            @T("Welcome, <strong>{0}</strong>!", new HtmlString(Html.ActionLink(WorkContext.CurrentUser.UserName, "Edit", new { Controller = "Home", Area = "Contrib.Profile" } ).ToString()))
            @Html.ActionLink(T("Change password").ToString(), "ChangePassword", new { Controller = "Account", Area = "Orchard.Users" })
        </span>
        <span class="user-actions">
            @Html.ActionLink(T("Sign Out").ToString(), "LogOff", new { Controller = "Account", Area = "Orchard.Users", ReturnUrl = Context.Request.RawUrl })
            @if (AuthorizedFor(Orchard.Security.StandardPermissions.AccessAdminPanel))
            {
                @Html.ActionLink(T("Dashboard").ToString(), "Index", new { Area = "Dashboard", Controller = "Admin" })
            }
        </span>
    }
    else
    {
        <span class="user-actions">@Html.ActionLink(T("Sign In").ToString(), "LogOn", new { Controller = "Account", Area = "Orchard.Users", ReturnUrl = (Context.Request.QueryString["ReturnUrl"] ?? Context.Request.RawUrl) })</span>
    }
</div>
